import axios from "../api/interceptor";

// 岗位与薪资接口
export interface positionSalaryType {
  position: string;
  salary: number;
}
// 城市与平均薪资接口
export interface provinceSalaryType {
  province: string;
  salary: number;
}
// 定义折线图的series数据类型
export interface Salary{
  year:number,
  salary:number
}
export interface SeriesItem{
  position:string,
  salaries:Salary[]
}
// 定义饼图数据类型
export interface pieType{
  age:string,
  count : number
}

// 获取岗位与薪资
export function positionSalary() {
  // return axios.get("/positionSalaryRank")
  return {
    data: [
      { position: "UI设计", salary: 1880 },
      { position: "运维", salary: 5000 },
      { position: "人工智能", salary: 6700 },
      { position: "python", salary: 1052 },
      { position: "前端开发", salary: 1000 },
      { position: "软件测试", salary: 1600 },
      { position: "后端开发", salary: 8000 },
      { position: "产品经理", salary: 7000 },
    ],
  };
}
// 获取岗位与平均薪资
export function provinceSalary() {
  return axios.get("/citySalary");
}

// 获取岗位十年来的平均薪资变化
export function salaryforYear() {
  // return axios.get('/changeOfSalary')
  return {       
    data: [
      {
        position: "前端开发",
        salaries: [
          { year: 2014, salary: 5000 },
          { year: 2015, salary: 3000 },
          { year: 2016, salary: 5000 },
          { year: 2017, salary: 5000 },
          { year: 2018, salary: 5000 },
          { year: 2019, salary: 6000 },
          { year: 2020, salary: 7000 },
          { year: 2021, salary: 8000 },
          { year: 2022, salary: 9000 },
          { year: 2023, salary: 9000 },
          { year: 2024, salary: 9000 },
        ],
      },
      {
        position: "后端开发",
        salaries: [
          { year: 2014, salary: 5000 },
          { year: 2015, salary: 5000 },
          { year: 2016, salary: 3000 },
          { year: 2017, salary: 5000 },
          { year: 2018, salary: 5000 },
          { year: 2019, salary: 6000 },
          { year: 2020, salary: 7000 },
          { year: 2021, salary: 8000 },
          { year: 2022, salary: 9000 },
          { year: 2023, salary: 11000 },
          { year: 2024, salary: 9000 },
        ],
      },
      {
        position: "运维",
        salaries: [
          { year: 2014, salary: 5000 },
          { year: 2015, salary: 5000 },
          { year: 2016, salary: 3000 },
          { year: 2017, salary: 6000 },
          { year: 2018, salary: 5000 },
          { year: 2019, salary: 6000 },
          { year: 2020, salary: 7000 },
          { year: 2021, salary: 6000 },
          { year: 2022, salary: 2000 },
          { year: 2023, salary: 1000 },
          { year: 2024, salary: 8000 },
        ],
      },
      {
        position: "产品经理",
        salaries: [
          { year: 2014, salary: 5000 },
          { year: 2015, salary: 5000 },
          { year: 2016, salary: 3000 },
          { year: 2017, salary: 2000 },
          { year: 2018, salary: 5000 },
          { year: 2019, salary: 6330 },
          { year: 2020, salary: 7000 },
          { year: 2021, salary: 8000 },
          { year: 2022, salary: 8800 },
          { year: 2023, salary: 6000 },
          { year: 2024, salary: 9000 },
        ],
      },
      {
        position: "测试",
        salaries: [
          { year: 2014, salary: 5000 },
          { year: 2015, salary: 5000 },
          { year: 2016, salary: 3000 },
          { year: 2017, salary: 9900 },
          { year: 2018, salary: 5000 },
          { year: 2019, salary: 8800 },
          { year: 2020, salary: 7000 },
          { year: 2021, salary: 8000 },
          { year: 2022, salary: 9099 },
          { year: 2023, salary: 11000 },
          { year: 2024, salary: 9000 },
        ],
      },
    ],
  };
}
// 获取从业年龄百分比数据
export function ageInComputer(){
  // return axios.get('/ageInComputer')
  return {
    data:[
      {age:'18-24',count:52},
      {age:'25-29',count:52},
      {age:'30-34',count:23},
      {age:'35-39',count:53},
      {age:'40-44',count:77},
      {age:'45-49',count:22},
     {age:'50-54',count:11},
    ]
  }
}
